<%= render :partial => "navigation" %>

    <!--Shoutouts Start-->

    <div id="shoutouts-block">

      <div id="so-bg-img">

        <img src="/images/shoutouts_apo.jpg" />

      </div>

      <div id="so-bg">

        <ul>

          <li>

<% form_tag({:action => "post_member", :member_id => session[:user]}, {:style => "display: inline"}) do -%>
<%= text_field_tag "message", nil, :maxlength => 160, :class => "shoutouts-textarea", :value => "Make A Shoutout!" -%>
<%= submit_tag "shout!", :disable_with => "wait...", :class => "shoutouts-button" -%>
<% end -%>

          </li>

        </ul>

      </div>

      <div id="shoutouts-block-feed">

        <div id="recent-shoutouts-feed">

        <marquee behavior="scroll" direction="up" onmouseover=this.stop() onmouseout=this.start() height="58" 
   scrollamount="1" scrolldelay="10"">

          <% cache :action => :home, :action_suffix => "announcements_#{session[:user].admin?}" do %>

          <%= render :partial => "shoutouts", :locals => {:announcements => Announcement.find_shoutouts} %>

        </marquee>

        </div>

      </div>

    </div>

    <!--Shoutouts End-->

    <!--Page Content Start-->

    <div id="content-pri-frame">

      <div id="content-pri-frame-left">

        <div id="content-pri-frame-left-id">

          <div class="member-name"><%= link_to_unless_current session[:user].first_name, :controller => "members", :action => "show", :id => session[:user] %> <%= link_to_unless_current session[:user].last_name, :controller => "members", :action => "show", :id => session[:user] %></div>

          <div class="member-status"><% if (@member.status == "Active")%>Active Member<% elsif(@member.status == "New Active") %>New Active<% elsif(@member.status == "Associate") %>Associate<% elsif(@member.status == "Probate") %>Probate<% elsif(@member.status == "Neophyte") %><% elsif(@member.status == "Pledge") %>Pledge<% else %>IDK?<% end %></div>

        </div>

        <div id="content-pri-frame-left-common">

          <div class="gen-title">Current Progress</div>

          <% if (@member.status == "Active" or @member.status == "New Active" or @member.status == "Associate" or @member.status == "Probate" or @member.status == "Neophyte")%>

          <div class="gen-sub-title">Total Progress</div>

          <div class="gen-sub-title-2"><%=h @memberData["percent"].to_i %>%</div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_total"].to_i %>" /></div>

          <div class="gen-sub-title">Service Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["service"]["actual"] %>/<%= @memberData["total_required_hours"] %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_service"].to_i %>" /></div>

          <div class="gen-sub-title">Leadership Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["leadership"]["actual"].to_i %>/<%= Member.active_leaderships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_leaderships"].to_i %>" /></div>

          <div class="gen-sub-title">Fellowship Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["fellowship"]["actual"].to_i %>/<%= Member.active_fellowships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_fellowships"].to_i %>" /></div>

          <div class="gen-sub-title">Meeting Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["meeting"]["actual"].to_i %>/<%= Member.active_meetings_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_meetings"].to_i %>" /></div>

          <div class="gen-sub-title">Fundraising Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["fundraiser"]["actual"].to_i %>/<%= Member.active_fundraisers_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_fundraisers"].to_i %>" /></div>

          <div class="gen-sub-title">TriSec Requirements</div>

          <div class="gen-sub-title-2"><%= h @memberData["trisec"]["actual"].to_i %>/<%= Member.active_trisecs_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_trisecs"].to_i %>" /></div>

          <div class="gen-sub-title">Dues</div>

          <div class="gen-sub-title-2"><%=h @memberData["dues"].to_i %>/<%= Member.active_dues_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["bar_dues"].to_i %>" /></div>

          <% elsif(@member.status == "Pledge") %>

          <div class="gen-sub-title">Total Progress</div>

          <div class="gen-sub-title-2"><%= h @memberData["percent"].to_i %>%</div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_2"].to_i %>" /></div>

          <div class="gen-sub-title">Service Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["service"]["actual"] %>/<%= @memberData["total_required_hours"] %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_service"].to_i %>" /></div>

          <div class="gen-sub-title">Leadership Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["leadership"]["actual"].to_i %>/<%= Member.pledge_leaderships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Fellowship Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["fellowship"]["actual"].to_i %>/<%= Member.pledge_fellowships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_fellowships"].to_i %>" /></div>

          <div class="gen-sub-title">Meeting Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["meeting"]["actual"].to_i %>/<%= Member.pledge_meetings_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_meetings"].to_i %>" /></div>

          <div class="gen-sub-title">Fundraising Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["fundraiser"]["actual"].to_i %>/<%= Member.pledge_fundraisers_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_fundraisers"].to_i %>" /></div>

          <div class="gen-sub-title">Pledge Requirements</div>

          <div class="gen-sub-title-2"><%= h @memberData["pledge_req"]["actual"].to_i %>/<%= Member.pledge_reqs_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_pledge_reqs"].to_i %>" /></div>

          <div class="gen-sub-title">Dues</div>

          <div class="gen-sub-title-2"><%= h @memberData["dues"].to_i %>/<%= Member.pledge_dues_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="<%=h @memberData["percent_dues"].to_i %>" /></div>
          <% else %>

          <div class="gen-sub-title">Something Broke :(</div>

          <% end %>

          <div class="spacer"> </div>

        </div>

        <div id="content-pri-frame-left-common">

          <div class="gen-title">Potential Progress</div>
          <% if (@member.status == "Active" or @member.status == "New Active" or @member.status == "Associate" or @member.status == "Probate" or @member.status == "Neophyte")%>
          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Service Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["service"]["potential"] %>/<%= @memberData["total_required_hours"] %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Leadership Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["leadership"]["potential"].to_i %>/<%= Member.active_leaderships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Fellowship Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["fellowship"]["potential"].to_i %>/<%= Member.active_fellowships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Meeting Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["meeting"]["potential"].to_i %>/<%= Member.active_meetings_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Fundraising Points</div>

          <div class="gen-sub-title-2"><%=h @memberData["fundraiser"]["potential"].to_i %>/<%= Member.active_fundraisers_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">TriSec Requirements</div>

          <div class="gen-sub-title-2"><%= h @memberData["trisec"]["potential"].to_i %>/<%= Member.active_trisecs_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Dues</div>

          <div class="gen-sub-title-2"><%=h @memberData["dues"].to_i %>/<%= Member.active_dues_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>
          <% elsif(@member.status == "Pledge") %>
          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Service Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["service"]["potential"] %>/<%= @memberData["total_required_hours"] %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Leadership Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["leadership"]["potential"].to_i %>/<%= Member.pledge_leaderships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Fellowship Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["fellowship"]["potential"].to_i %>/<%= Member.pledge_fellowships_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Meeting Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["meeting"]["potential"].to_i %>/<%= Member.pledge_meetings_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Fundraising Points</div>

          <div class="gen-sub-title-2"><%= h @memberData["fundraiser"]["potential"].to_i %>/<%= Member.pledge_fundraisers_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Pledge Requirements</div>

          <div class="gen-sub-title-2"><%= h @memberData["pledge_req"]["potential"].to_i %>/<%= Member.pledge_reqs_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>

          <div class="gen-sub-title">Dues</div>

          <div class="gen-sub-title-2"><%= h @memberData["dues"].to_i %>/<%= Member.pledge_dues_requirement %></div>

          <div class="per-box"><img src="/images/progress_per.jpg" width="0" /></div>
          <% else %>

          <div class="gen-sub-title">Something Broke :(</div>

          <% end %>
          <div class="spacer"> </div>

        </div>

      </div>

      <div id="content-pri-frame-center">

<% if @member.email == "" %>
    <div id="notices" class="noticeBox">
        <%= link_to "Please update your email address!",
                    {:controller => "members", :action => "edit", :id => @member.id} %>
    </div>
<% elsif @srcToggle and not @member.signed_src %>
    <div id="notices" class="noticeBox">
        <%= link_to "Please sign the SRC!",
                    {:controller => "members", :action => "src"},
                    {:popup => ['new_window', 'height=600,width=800']} %>
    </div>
<% end %>

        <div class="pri-title">Announcements</div>

          <%= render :partial => "announcements", :locals => {:announcements => Announcement.find_announcements} %>

          <% end %>

        <% if session[:user].admin %>

        <div class="pri-title">Post An Announcement</div>

        <div class="ann-mess">

        <% form_tag({:action => "post_admin", :member_id => session[:user]}, {:style => "display: inline"}) do -%>
        <%= text_field_tag "message", nil, :maxlength => 160, :style => "width: 20em" -%>
        <%= submit_tag "post", :disable_with => "wait..." -%>
        <% end -%>

        </div>
        <% end %>

        <div class="spacer"> </div>

        <div class="pri-title">Your Upcoming Events</div>

        <div class="ann-mess">

          <div class="cellRow cellRowHeader">

            <div class="cellBlock">Event</div>

            <div class="cellBlock">When</div>

          </div>
          <% if @events.length == 0 %>
          <div>

            <div>None =(</div>

            <div>&nbsp;</div>

          </div>
          <% else %>
          <% @events.each_with_index do |event, index| %>
          <div class="cellRow cellRow<%= index % 2 == 0?1:2 %>">
            <% if event.date.future? %>
            <div class="cellBlock"><%= link_to h(event.name), :controller=> "events", :action => "show" , :id => event %></div>

            <div class="cellBlock"><% if event.date.today? %>Today at <%=h event.date.strftime("%I:%M %p")%><% else %><%=h event.date.strftime("%A, %b %d at %I:%M %p") %><% end %></div>
            <% end %>
          </div>
          <% end %>
          <% end %>
        </div>

      </div>

      <div id="content-pri-frame-right">

        <div id="content-pri-frame-right-common">

          <div class="gen-title">Birthdays</div>

<% cache :action => :home, :action_suffix => "birthday_#{Date.today}" do %>
          <!-- Birthdays here -->
<% counter = 0 %>
<% Member.find_birthdays.each do |member| %>
<% if member.age.to_i > 10 %>

          <div class="gen-sub-title"><%= link_to h(member.full_name), :controller => "members", :action => "show", :id => member %></div>

          <div class="gen-sub-title-2"><% if(member.birthday.day == Date.today.day and member.birthday.mon == Date.today.mon) %>Today<% else %><%=h member.birthday.strftime("%m/%d") %><% end %></div>

          <div class="gen-sub-title-3"><%=h member.age %></div>
<% counter = counter + 1 %>
<% end %>
<% end %>
		<% if counter == 0 %>
<div class="gen-sub-title">None! :(</div>
		<% end %>
<% end %>

          <div class="spacer"> </div>

        </div>

      </div>

    </div>

    <!--Page Content End-->

<%= render :partial => "footer" %>